package com.rocbrid.storage.controller;

import com.rocbrid.common.R;
import com.rocbrid.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController {
    @Autowired
    private StorageService storageService;

    @GetMapping("/deduct")
    public R deduct(@RequestParam("commodityCode") String commodityCode,
                    @RequestParam("count") Integer count) {
        storageService.deduct(commodityCode, count);
        return R.ok("deduct success...");
    }
}